@extends('default.mobile.layouts.personalPublic')
@section('title','语言能力-'.Site::get('webname'))
{{--首页css--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/mobile/personal/common.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/mobile/jquery/select.css')}}">
@endsection
{{--头部标签--}}
@section('tag','语言能力')
@section('link') href="{{url('mobile/personal/resume_manage?parameter=language&resume_id='.$resume_id)}}" @endsection

{{--主体内容--}}
@section('content')
    <div class="fill" id="fill" style="overflow: hidden">
        <div class="form_info" id="form_info">
            <form action="" onsubmit="return checkLanguage('#languageForm','/mobile/personal/add_language')"
                    method="post" id="languageForm" name="languageForm">
                {{csrf_field()}}
                <input type="hidden" name="resume_id" id="resume_id"  value="{{$resume_id}}">
                <dl class="arrow" id="language_select">
                    <input type="hidden" name="language" value="{{old('language')}}" id="language" />
                    <dt>选择语种<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择语种</span></dd>
                </dl>
                <dl class="arrow" id="degree_select">
                    <input type="hidden" name="degree" value="{{old('degree')}}" id="degree" />
                    <dt>熟练程度<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择熟练程度</span></dd>
                </dl>
                <dl class="arrow" id="level_select">
                    <input type="hidden" name="level" value="{{old('level')}}" id="level" />
                    <dt>语言等级</dt>
                    <dd><span class="select_text">请选择语言等级</span></dd>
                </dl>
                <div class="form_sub"><input type="submit" id="sub" value="保存"></div>
            </form>
        </div>
    </div>
@endsection

@section('footerjs')
    @parent
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select.js')}}"></script>
    <script type="text/javascript" src="{{Resources::jsOption('resume')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/personal/resume_manage.js')}}"></script>
    <script>
        $(function(){
            var fill = $("#fill").find('#form_info');
            var _token = "{{csrf_token()}}";
            //选择语种
            fill.find("#language_select").select({
                select_title:'选择语种',                //标题值
                hidden: '#language',                   //select隐藏表单值
                opt_data:option_language,               //select选项值（数组json对象）
                callback:function(val){
                    $.ajax({
                        url: '/common/two_options',
                        dataType: "json",
                        data: "selectPid="+val+"&_token="+_token+"&sign=language",
                        type: "POST",
                        success: function (data) {
                            fill.find("#level_select").select({
                                select_title:'语言等级',
                                hidden: '#level',
                                opt_data:data,
                                sel_load:true
                            });
                        },
                        error: function () {
                            layerMsg('加载错误，可能网络原因引起的错误',1);
                        }
                    });
                }
            });
            //熟练程度
            fill.find("#degree_select").select({
                select_title:'熟练程度',                //标题值
                hidden: '#degree',                   //select隐藏表单值
                opt_data:option_degree               //select选项值（数组json对象）
            });
        });
    </script>
@endsection